#!/usr/bin/python3

import json

filename = "record.json"
name = input("type your name:\n")
favor_num = input("type your favor num:\n")

dic = {name:favor_num}
with open(filename,"w") as f_obj:
    #json.dump(dic, f_obj)
    json.dump(dic, f_obj, indent=4, ensure_ascii=False)


with open(filename) as f_obj:
    dic = json.load(f_obj)
    print(dic)

